load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "spanconfigsqlwatcher",
    srcs = [
        "buffer.go",
        "protectedtsdecoder.go",
        "sqlwatcher.go",
        "zonesdecoder.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/spanconfig/spanconfigsqlwatcher",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv/kvclient/rangefeed",
        "//pkg/kv/kvclient/rangefeed/rangefeedbuffer",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descbuilder",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "spanconfigsqlwatcher_test",
    srcs = [
        "buffer_test.go",
        "main_test.go",
        "protectedtsdecoder_test.go",
        "zonesdecoder_test.go",
    ],
    embed = [":spanconfigsqlwatcher"],
    deps = [
        "//pkg/base",
        "//pkg/config/zonepb",
        "//pkg/jobs",
        "//pkg/jobs/jobsprotectedts",
        "//pkg/keys",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/kv/kvserver/protectedts/ptstorage",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/spanconfig",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/distsql",
        "//pkg/sql/isql",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/uuid",
        "@com_github_gogo_protobuf//proto",
        "@com_github_stretchr_testify//require",
    ],
)
